CXXFLAGS += -std=c++17
CFLAGS += -DOPENCV
objects = main.o YoloMgr.o Singleton.o PolygonDetection.o OnceDetector.o Utility.o
objects += json_reader.o json_value.o json_writer.o
cppversion = -std=c++17
cppflag = -c -g
cppflag += -I include/json -I include
a.out: $(objects)
	g++ -o a.out $(objects) `pkg-config --cflags --libs opencv4` -L. -lpthread -ldarknet -lhv
main.o: main.cpp
	g++ $(cppflag) $(cppversion) main.cpp
YoloMgr.o: YoloMgr.cpp YoloMgr.h Singleton.h OnceDetector.h
	g++ $(cppflag) $(cppversion) YoloMgr.cpp 
Singleton.o: Singleton.cpp Singleton.h
	g++ $(cppflag) $(cppversion) Singleton.cpp
PolygonDetection.o: PolygonDetection.cpp PolygonDetection.h
	g++ $(cppflag) $(cppversion) PolygonDetection.cpp
OnceDetector.o: OnceDetector.cpp OnceDetector.h
	g++ $(cppflag) $(cppversion) OnceDetector.cpp
Utility.o: Utility.cpp Utility.h
	g++ $(cppflag) $(cppversion) Utility.cpp
json_reader.o: json_reader.cpp
	g++ $(cppflag) $(cppversion) json_reader.cpp
json_value.o: json_value.cpp
	g++ $(cppflag) $(cppversion) json_value.cpp
json_writer.o: json_writer.cpp
	g++ $(cppflag) $(cppversion) json_writer.cpp
.PHONY:clean
clean:
	-rm a.out $(objects)
